<template>
  <div id="userLayout">
    <a-layout class="layout" style="min-height: 100vh">
      <a-layout-header class="header">
        <GlobalHeader />
      </a-layout-header>
      <a-layout-content class="content">
        <router-view />
      </a-layout-content>
      <a-layout-footer class="footer">
        <GlobalFooter />
      </a-layout-footer>
    </a-layout>
  </div>
</template>

<script setup lang="ts">
import GlobalHeader from "@/components/GlobalHeader.vue";
import GlobalFooter from "@/components/GlobalFooter.vue";
</script>

<style scoped>
#userLayout {
  height: 100vh; /* 使布局占满整个视口高度 */
  display: flex;
  flex-direction: column;
}

.layout {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

#userLayout .header {
  flex-basis: 10%; /* 占高度的20% */
}

#userLayout .content {
  background: url("https://gw.alipayobjects.com/zos/rmsportal/FfdJeJRQWjEeGTpqgBKj.png")
    0% 0% / 100% 100%;
  flex-basis: 60%; /* 占高度的60% */
  overflow-y: auto; /* 如果内容溢出，添加滚动条 */
  padding: 20px;
}

#userLayout .footer {
  padding: 16px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  flex-basis: 20%; /* 占高度的20% */
}
</style>
